improvement(workflow): seed start block on server side#3890
improvement(workflow): seed start block on server side#3890icecrasher321 merged 5 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Workspace creation was adjusted to seed the initial workflow state within the existing transaction (removing the follow-up seeding step), and workflow persistence utilities now accept an optional external transaction. On the client, workflow creation flows switch to an optimistic “creating” hydration phase (new registry actions Written by Cursor Bugbot for commit 4f1bc29. Configure here. |
Greptile SummaryThis PR improves workflow creation by moving start block seeding to the server side (previously done client-side via a separate Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UI (sidebar)
participant Store as WorkflowRegistry
participant Mutation as useCreateWorkflow
participant Server as POST /api/workflows
participant Socket as SocketProvider
participant WF as workflow.tsx
UI->>Mutation: mutate({ id, name, color })
UI->>Store: markWorkflowCreating(id) → phase='creating'
UI->>WF: router.push(/w/id)
WF-->>WF: effect fires, phase='creating' → return early (no load)
Socket-->>Socket: effect fires, phase='creating' → skip room join
Mutation->>Server: POST /api/workflows
Server->>Server: buildDefaultWorkflowArtifacts()
Server->>Server: saveWorkflowToNormalizedTables() — throws on failure
Server-->>Mutation: 200 { id, startBlockId, subBlockValues }
alt Success
Mutation->>Store: markWorkflowCreated(id)
Store->>Store: loadWorkflowState(id) → phase='state-loading'
Socket-->>Socket: phase≠'creating' → join-workflow room
Store-->>WF: phase='ready'
else Error
Mutation->>Store: markWorkflowCreated(null) → phase='idle'
WF-->>WF: redirect effect fires, currentWorkflowExists=false → redirect
end
Reviews (2): Last reviewed commit: "add creating state machine for optimisti..." | Re-trigger Greptile |
|
bugbot run |
|
@greptile |
|
bugbot run |
|
bugbot run |
|
bugbot run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Summary
Type of Change
Testing
Tested manually
Checklist